from cyaron import *

#predata
name = "tree" 
# 输入题目的标题
# 定义可能需要的值的最大范围
size = 100

for i in range(1, 11):  
# for循环样例的编号，希望是1到20个样例就把11改成21
    test_data = IO(file_prefix=name, data_id=i)
    if i < 4:
        l = randint(1, 100) * size
        m = randint(1, 100)
    else:
        l = randint(1, 10000) * size
        m = randint(1, 10000)
    # 造任意字符
    # writeln data
    test_data.input_writeln(l, m)
    # 数据写入.in文件
    for j in range(m):
        a = randint(1, l)
        b = randint(a, l)
        test_data.input_writeln(a, b)
    # run data by shell
    test_data.output_gen("./"+name)     
    # 执行代码，自动生成.out文件